package org.yefei.homeworkday15.three;

//战斗机类
public class Warcraft extends AirPlane {
	private int numberOfWarheads;// 弹头数

	public Warcraft(double weight, double height, String type, int numberOfWarheads) {
		super(weight, height, type);
		this.numberOfWarheads = numberOfWarheads;
	}

	public int getNumberOfWarheads() {
		return numberOfWarheads;
	}

	public void setNumberOfWarheads(int numberOfWarheads) {
		if (numberOfWarheads < 0) {
			System.err.println("弹头数不合理！");
			numberOfWarheads = 100;
		}
		this.numberOfWarheads = numberOfWarheads;
	}

	public void dirveCircle() {
		System.out.println(super.getType() + "可以低空盘旋！");
	}

	public void lanch() {
		System.out.println(super.getType() + "可以发射导弹！");
	}
	@Override
	public void takeOf() {
		System.out.println("重量为" + super.getWeight() + "吨的" + super.getType() + "起飞，走你！");
	}

	@Override
	public void accelerate() {
		System.out.println("携带" + numberOfWarheads + "枚导弹的" + super.getType() + "疯狂加速，哇哦！");
	}

	@Override
	public void landing() {
		System.out.println("上升到" + super.getHeight() + "米的高空后，加速降落，欢迎回来！");

	}

}
